package com.enumDemo;

public class Ceshi01 {
    public static void main(String[] args) {

        //调用有参构造函数
        Season s=Season.SPRING;

        System.out.println(s.getMsg());




        // 输出 key 为 1 的枚举值实例
        Season season = Season.valueofKey(1);

        System.out.println(season);

// 输出 SPRING 实例对应的 key
        Integer key = Season.SPRING.getKey();
        System.out.println(key);
// 输出 SPRING 实例对应的 msg
        String msg = Season.SPRING.getMsg();
        System.out.println(msg);


        System.out.println(Season.valueofKey(2).getMsg());


        System.out.println(Season.msgToKey("summer"));
        System.out.println(Season.keyToMsg(3));



    }
}
